/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <ctype.h>

#include "Flash.h"
#include "ADC.h"
#include "Uart.h"
//#include "TIM.h"
#include "EC801.h"
#include "RS485.h"
#include "TCP_SYS.h"



/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */
//extern void Delay_us(uint32_t nus);
extern void Delay_ms(uint32_t nms);
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define EN_wuxian_Pin GPIO_PIN_0
#define EN_wuxian_GPIO_Port GPIOA
#define wuxian_RST_Pin GPIO_PIN_1
#define wuxian_RST_GPIO_Port GPIOA
#define wuxian_TX_Pin GPIO_PIN_2
#define wuxian_TX_GPIO_Port GPIOA
#define wuxian_RX_Pin GPIO_PIN_3
#define wuxian_RX_GPIO_Port GPIOA
#define ADC_BAT_Pin GPIO_PIN_4
#define ADC_BAT_GPIO_Port GPIOA
#define ADC_24V_Pin GPIO_PIN_5
#define ADC_24V_GPIO_Port GPIOA
#define ADC_Pressure_Pin GPIO_PIN_6
#define ADC_Pressure_GPIO_Port GPIOA
#define ADC_PT100_Pin GPIO_PIN_7
#define ADC_PT100_GPIO_Port GPIOA
#define LCNTR_Pin GPIO_PIN_2
#define LCNTR_GPIO_Port GPIOB
#define F485_TX_Pin GPIO_PIN_10
#define F485_TX_GPIO_Port GPIOB
#define F485_RX_Pin GPIO_PIN_11
#define F485_RX_GPIO_Port GPIOB
#define EN_485_Pin GPIO_PIN_13
#define EN_485_GPIO_Port GPIOB
#define EN_BOOST_Pin GPIO_PIN_14
#define EN_BOOST_GPIO_Port GPIOB
#define EN_ADC_Pin GPIO_PIN_15
#define EN_ADC_GPIO_Port GPIOB
#define BUZZER_Pin GPIO_PIN_12			//todo
#define BUZZER_GPIO_Port GPIOB
#define PCNTR_Pin GPIO_PIN_8
#define PCNTR_GPIO_Port GPIOA
#define P485_TX_Pin GPIO_PIN_9
#define P485_TX_GPIO_Port GPIOA
#define P485_RX_Pin GPIO_PIN_10
#define P485_RX_GPIO_Port GPIOA
#define LCD_RST_Pin GPIO_PIN_4
#define LCD_RST_GPIO_Port GPIOB
#define LCD_D_C_Pin GPIO_PIN_6
#define LCD_D_C_GPIO_Port GPIOB
#define LCD_CS_Pin GPIO_PIN_7
#define LCD_CS_GPIO_Port GPIOB
#define LCD_BL_Pin GPIO_PIN_8
#define LCD_BL_GPIO_Port GPIOB
#define LCD_OPEN_Pin GPIO_PIN_9
#define LCD_OPEN_GPIO_Port GPIOB
#define SW485B_Pin GPIO_PIN_12			//todo
#define SW485B_GPIO_Port GPIOA
#define SW485A_Pin GPIO_PIN_11			//todo
#define SW485A_GPIO_Port GPIOA
#define Key_Pin GPIO_PIN_13			//todo
#define Key_GPIO_Port GPIOC




/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
